{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "字典(Dictionary)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2\n",
      "{'a': 1, 'b': 2, 'c': 3, 'h': 3}\n",
      "{'aq': 12, 'ab': 11}\n",
      "{'aq': 12, 'ab': 11, 'lp': 6}\n"
     ]
    }
   ],
   "source": [
    "'''\n",
    "字典是另一种可变容器模型，且可存储任意类型对象。\n",
    "\n",
    "字典的每个键值 key=>value 对用冒号 : 分割，每个键值对之间用逗号 , 分割，整个字典包括在花括号 {}\n",
    "\n",
    "'''\n",
    "\n",
    "dic = {'a':1,'b':2,'c':3}\n",
    "print(dic['b'])\n",
    "dic['h'] = 3\n",
    "print(dic)\n",
    "dic2 = {'aq':12,'ab':11}\n",
    "print(dic2)\n",
    "dic2['lp'] = 6;\n",
    "print(dic2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
